import vue from '@vitejs/plugin-vue';
import { resolve } from "path";
import { defineConfig } from 'vite';

import AutoImport from "unplugin-auto-import/vite";

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      "@": resolve(__dirname, "src"),
    },
  },
  css: {
    // CSS 预处理器
    preprocessorOptions: {
      // 定义全局 SCSS 变量
      scss: {
        javascriptEnabled: true,
        additionalData: `
          @use "@/styles/variables.scss" as *;
        `,
      },
    },
  },
  plugins: [
    vue(),
    AutoImport({
      imports: ["vue", "@vueuse/core", "pinia", "vue-router"],
    })
  ],

  server: {
    host: "0.0.0.0"
  }

})
